<template>
  <div class="mine">
    <div class="container">
      <div class="c-top">
        <img  v-if="store.userInfo.phone"  class="img " src="https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/产品详情/u1927.png">
        <span v-if="store.userInfo.phone" style="color:white ; font-size:13px ">{{store.userInfo.phone}}</span>
        <span v-else  class="login" @click="jump('login')">登录</span>        
      <span class="c-rig" @click="jump('score')">
        <img src="https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/我的/u3433.png">签到领积分
      </span>
      </div>
      <div class="c-bot">
        <div @click="jump('coupon')"><p>4</p><span>优惠券</span></div>
        <div @click="jump('score')"><p>{{store.userInfo.scores ? store.userInfo.scores : 0}}</p><span>积分</span></div>
        <div @click="jump('news')"><p>3</p><span>消息</span></div>
      </div>
    </div>
    <div class="content">
      <div class="order" >
          <div class="order-top" style="margin:10px">
            <span>我的订单</span>
            <span @click="jump('order')">查看全部订单</span>
          </div>
          <van-grid :border="false" :column-num="6" @click="jump('order')">
              <van-grid-item icon="pending-payment" text="待支付" />  
              <van-grid-item icon="send-gift-o" text="待发货" />  
              <van-grid-item icon="logistics" text="待收货" />  
              <van-grid-item icon="chat-o" text="待评价" />  
              <van-grid-item icon="passed" text="已完成" />  
              <van-grid-item icon="cash-back-record" text="退款" />  
          </van-grid>

      </div>
      <div class="tools">
        <p>常用工具</p>
        <van-grid :border="false" :column-num="3">
              <van-grid-item icon="location-o" text="地址管理" @click="jump('address')"/>  
              <van-grid-item icon="service-o" text="在线客服"  @click="jump('service')" />  
              <van-grid-item icon="records" text="意见反馈"  @click="jump('opinion')"/>  
              <van-grid-item icon="setting-o" text="设置"  @click="jump('setting')"/>  
              <van-grid-item icon="enlarge" text="扫一扫"  @click="jump('scan')"/>  
          </van-grid>
      </div>
    </div>
  </div>
</template>

<script setup>
import useUserStore  from '../../store/user'
import { useRouter, useRoute } from 'vue-router'
  const store = useUserStore()
  const router = useRouter()
  const jump=(url) =>{
   router.push('/'+url)
  }
</script>

<style scoped> 
  .mine{
    width: 100%;
    height: 617px;
    overflow-y: scroll;
  }
  .p{
    color: #333;
    font-size: 16px;
    padding-left: 20px;
    box-sizing: border-box  ;
    
  }
  .container{
    width: 100%;
    height: 204px;
    overflow: hidden;
    background-image: url("https://cimg.axureshop.com/28/d0/93/28d0933e0c9f40ce99dc79bdae082541/images/我的/u3340.png");
    padding: 20px;
    padding-top: 25px;
    box-sizing: border-box;
  }
  .container .c-top .img{
    float: left;
  }
  .container .c-top .login{
    color: black;
    font-size:13px;
    display: inline-block;
    width: 60px;
    height: 30px;
    border-radius: 15px;
    background-color: white;
    line-height: 30px;
    text-align: center;
  }
  .container .c-top .c-rig{
    font-size: 13px;
    background-color: #fff;
    height: 30px;
    float: right;
    width: 115px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
  }
  .container .c-top .c-rig img{
    width: 20px;
  }
  .container .c-bot{
    display: flex;
    font-size: 16px;
    color: white;
    justify-content: space-around;
    align-items: center;
    margin-top: 60px;
    margin-left: 0;
  }

  .container .c-bot div{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .container .c-bot div p{
    color: white;
  }

  .content {
    background-color: rgba(242, 242, 242, 1);
    overflow: hidden;
  }
  .content .order{
    padding: 20px 10px;
    background-color: white;
    width: 90%;
    margin: 10px auto;
  }

  .content .tools{
    padding: 20px 10px;
    background-color: white;
    width: 90%;
    margin: 10px auto;

  }

  .content .tools p{
    padding-left: 10px;    
  }
  .content .order .order-top{
    padding: 0px 10px;
  }
  .content .order .order-top span:nth-child(1){
    font-size: 16px;
  }

  .content .order .order-top span:nth-child(2){
    font-size: 13px;
    float: right;
  }

  ::-webkit-scrollbar{
    display: none;
  }
</style>
